MoviesTask
TheMoviesTask
function services active movies.
pascal void MoviesTask (Movie theMovie, long maxMilliSecToUse);
theMovie
- Specifies the movie for this operation. If you set this parameter to
nil
, the Movie Toolbox services all of your active movies. Your application obtains this movie identifier from such functions asNewMovie
,NewMovieFromFile
, andNewMovieFromHandle
(described on page 2-80, page 2-76, and page 2-78, respectively).maxMilliSecToUse
- Determines the maximum number of milliseconds that
MoviesTask
can work before returning. If this parameter is 0,MoviesTask
services every active movie exactly once and then returns. If the parameter is nonzero,MoviesTask
services as many movies as it can in the allotted time before returning.- Once the
MoviesTask
function starts servicing a movie, it cannot stop until it has completely met the requirements of the movie. Consequently, theMoviesTask
function may execute for a longer time than that specified inmaxMilliSecToUse
. However, the function does not start servicing a new movie if the time specified bymaxMilliSecToUse
has elapsed.- The preferred way to use
MoviesTask
is to set themaxMilliSecToUse
parameter to 0; however, if you just want to play one movie, you can callMoviesTask
on that one.- If your rate is 0,
MoviesTask
draws that frame and no other.DESCRIPTION
When servicing a movie, the Movie Toolbox performs the processing that is appropriate for the movie--displaying frames, playing sound, reading data from disk, or other tasks. The only time the Movie Toolbox actually draws a movie is during the operation of theMoviesTask
function.You should call
MoviesTask
as often as possible from your application's main event loop. Note that you should call this function after you have performed your own event processing.The
MoviesTask
function services only active movies, and only enabled tracks within those active movies. Use theSetMovieActive
function (described on page 2-131) and theSetTrackEnabled
function (described on page 2-132) to enable and disable movies and tracks.SPECIAL CONSIDERATIONS
Note that theMoviesTask
function services only your movies. Your application must call the Event Manager'sWaitNextEvent
routine (or the Event Manager'sGetNextEvent
routine and theSystemTask
routine) to give other applications the opportunity to callMoviesTask
for their movies. For details onWaitNextEvent
,GetNextEvent
, andSystemTask
, see Inside Macintosh: Macintosh Toolbox Essentials.ERROR CODES
invalidMovie -2010 This movie is corrupted or invalid